const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    allData:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getData();
  },
  getData() {
    let baseUrl = app.getNetAddresss("plugin.stock-service.frontend.controllers.home.index");
    app._getNetWork({
      url: baseUrl,
      success: (respone) => {
        let { data, msg, result } = respone.data;
        if (result) {
          this.setData({
            allData: data,
          });
          wx.setNavigationBarTitle({
            title: data.name,
          });
        } else {
          wx.showToast({
            title: msg,
          });
        }
      },
    });
  },
  goStockAggregatePage() {
    wx.navigateTo({
      url: "/packageF/stockService/stockAggregatePage/index",
    });
  },
  goMyInventoryPage(e) {
    wx.navigateTo({
      url: "/packageF/stockService/myInventory/index?name="+ e.currentTarget.dataset.name,
    });
  },
  goInventoryDetailsPage(e) {
    wx.navigateTo({
      url: "/packageF/stockService/inventoryDetails/index?name="+ e.currentTarget.dataset.name,
    });
  },
  goRevenueDetailsPage() {
    wx.navigateTo({
      url: "/packageF/stockService/revenueDetails/index",
    });
  },
  goFinancialStatementspage() {
    wx.navigateTo({
      url: "/packageF/stockService/financialStatements/index",
    });
  },
    // 存货订单
    inventoryOrder() {
      wx.navigateTo({
        url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=stockServiceInventory",
      });
    },
    // 提货订单
    pickUpOrders() {
      wx.navigateTo({
        url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=stockServicePickUp",
      });
    }
})